﻿using Landpy.CruiseControlNet.ConfigurationSidekick.ConfigTreeModule;

namespace Landpy.CruiseControlNet.ConfigurationSidekick.ConfigPropertyModule
{
    class CruiseControlHandler : GetPropertiesHandler
    {
        public override object GetPropertiesObject(GetPropertiesContext getPropertiesContext)
        {
            var treeNodeIndentity = this.GetTreeNodeIndentity(getPropertiesContext);
            if (treeNodeIndentity.Type == TreeNodeType.CruiseControl)
            {
                return getPropertiesContext.CruiseControl;
            }
            return this.Successor.GetPropertiesObject(getPropertiesContext);
        }
    }
}
